Electronic devices, such as computers, for processing digitalized data usually have an external storage device for storing digital data and holding the data even when cut off from the power supply. The external storage device used is, for example, a magnetic disk or erasable programmable ROM.
With reference to FIG. 2, digital data is written to, or read or erased from an external storage device such as an erasable programmable ROM 1 under the control of a CPU 2. Since the CPU 2 writes or reads data to or from the ROM 1 in predetermined data lengths, the storage area of the ROM 1 is divided into regions of predetermined data length. The small regions thus divided will be referred to as "blocks 3," and the length of the blocks 3 as the "block length." To specify particular blocks on which the read or write operation is to be performed, an address is assigned to each of the blocks 3.
Further digital data is processed in the form of a unit of items grouped. The unit of items of digital data will be referred to as a "file 4," and the length of the file as the "file length." The file length is variable; some files are shorter than the block length, and some files are greater than the block length.
Accordingly, for the CPU 2 to write or read a file to or from the erasable programmable ROM 1, it is necessary to store, for every block and in a specified location of the ROM 1, information such as information indicating whether the block 3 has data stored therein, and information indicating the connection or relation between a plurality of blocks when the file is stored in the blocks. The information to be stored in the specified position of each block 3 will be termed a "block label 30."
With reference to FIG. 8 showing the procedure to be performed by the CPU 2 for writing a file 4 to the erasable programmable ROM 1, the CPU 2 searches the memory for a blank block (with no stored data) usually in the order of increasing block address values (S31) with reference to information such as block labels 30 stored in specified locations in the ROM 1 (S30), writing digital data of the file 4 and a block label 30 to the blank block found (S32) and repeating these steps until the entire digital data of the file 4 is written (S33, S34), whereby the information is updated (S35).
For example, suppose the erasable programmable ROM 1 is divided into blocks 3, and a block label 30 of predetermined length is stored as information at the head of each block 3 as shown in FIG. 1a. When a file F1 having such a length that it can be stored in two blocks and a file F2 having such a length as to be accommodated in three blocks are to be written to the ROM 1 in its initial state containing no digital data (FIG. 1a), the file F1 is written to the first two blocks (1)!, and the file F2 is written to the three blocks immediately following the first two blocks (2)! as shown in FIG. 1c. When a file F3 having such a length as to be stored in one block is to be written to the ROM 1 after the stored file F2 is deleted (3)!, the file F3 is written usually to the block immediately following the file F1 like the file F2. Consequently it is likely that data will be rewritten concentrically to blocks of small address values.
The external storage device is impaired in reliability when becoming unerasable even if locally. Especially the erasable programmable ROM 1 is limited in erasability, i.e., frequency of erasure, and the flash memory 10 is erasable up to about 10,000 times. If the flash memory 10 is erased approximately uniformly over its storage area, the memory which has been erased such a large number of times is still usable for a considerable period of time, whereas data is rewritten concentrically to a local area by the conventional storage method, with the result that unerasable region occurs to entail impaired reliability.
An object of the present invention is to provide a method of and device for writing digital data to the entire area of an erasable programmable ROM on the average without concentration on a local area of the ROM by utilizing the regions for storing the aforementioned information.